package cn.com.dycc.study_manage.integral.controller;

import java.io.UnsupportedEncodingException;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.com.dycc.common.controller.BaseController;
import cn.com.dycc.study_manage.integral.param.Pb_Integral_Dept_LogParam;
import cn.com.dycc.study_manage.integral.service.Pb_Integral_Dept_LogService;
import cn.com.dycc.util.JsonObjectResult;

@Controller
@RequestMapping("/study_manage/integral_dept_log")
public class Pb_Integral_Dept_LogController extends BaseController{

	@Resource
	private Pb_Integral_Dept_LogService pb_Integral_Dept_LogService;
	
	/**
	 * 用户所属的组织id下所有的党组织积分明细
	 * @param param
	 * @param session
	 * @param request
	 * @return
	 * @throws UnsupportedEncodingException
	 */
	@RequestMapping("/listAll.do")
	@ResponseBody
	public JsonObjectResult findAllPb_Integral_Dept_Log(Pb_Integral_Dept_LogParam param,HttpSession session,HttpServletRequest request) throws UnsupportedEncodingException{
		
		
		JsonObjectResult result=pb_Integral_Dept_LogService.findPb_Integral_Dept_LogByParam(param,request);
		
		return result;
	}
	
	/**
	 * 统计用户所属党组织的党组织积分
	 * @param param
	 * @param session
	 * @param request
	 * @return
	 * @throws UnsupportedEncodingException
	 */
	@RequestMapping("/statistics.do")
	@ResponseBody
	public JsonObjectResult findPb_Integral_Dept_LogCountByParam(Pb_Integral_Dept_LogParam param,HttpSession session,HttpServletRequest request) throws UnsupportedEncodingException{
		
		String dept_id=(String)session.getAttribute("dept_id");
		param.setDept_id(dept_id);
		JsonObjectResult result=pb_Integral_Dept_LogService.findPb_Integral_Dept_LogCountByParam(param, request);
		
		return result;
	}
	
	/**
	 * 统计用户所属的组织id下所有的党组织积分
	 * @param param
	 * @param session
	 * @param request
	 * @return
	 * @throws UnsupportedEncodingException
	 */
	@RequestMapping("/statisticsAll.do")
	@ResponseBody
	public JsonObjectResult findAllPb_Integral_Dept_LogCountByParam(Pb_Integral_Dept_LogParam param,HttpSession session,HttpServletRequest request) throws UnsupportedEncodingException{
		
		
		JsonObjectResult result=pb_Integral_Dept_LogService.findPb_Integral_Dept_LogCountByParam(param, request);
		
		return result;
	}
}
